import { http } from "@/utils/http";
import { baseUrlApi } from "./utils";
export type BannerResult = {
  page: number;
  pagesize: number;
  success: boolean;
  code: number;
  token: string;
  msg: string;
  data: {
    img(img: any): string;
    data: any[];
    total: number;
    page: number;
    pagesize: number;
  };
};
// 使用单位列表
export const useunitList= (data?: object) => {
  return http.request<BannerResult>("get", baseUrlApi(`admin/useunit/list?page=${data.page}&pagesize=${data.pagesize}&name=${data.name}&phone=${data.phone}`), {
    data
  });
};
// 使用单位添加
export const useunitInsert= (data?: object) => {
  return http.request<BannerResult>("post", baseUrlApi("admin/useunit/insert"), {
    data
  });
};
//使用单位修改
export const useunitUpdate = (data?: object) => {
  return http.request<BannerResult>("post", baseUrlApi("admin/useunit/update"), {
    data
  });
};
// 使用单位删除
export const useunitDelete = (data?: object) => {
  return http.request<BannerResult>("post", baseUrlApi("admin/useunit/delete"), {
    data
  });
};

